FROM redis:latest
# 设定时区
ENV TZ=Asia/Shanghai
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

# 这里写一个password参数由外面的yml文件传进来
ARG password
ENV PASSWORD ${password}
COPY redis.conf /usr/local/etc/redis/redis.conf
# 写一个shell脚本去启动的原因是因为 密码要这样传进去变量
ADD start.sh /usr/local/etc/redis/start.sh
CMD [ "/usr/local/etc/redis/start.sh"]